package org.flashbrighton.as3bots.views.ui
{
	import flash.display.*;
	import flash.text.*;
	
	public class Message extends Sprite
	{
		public static var tf:TextField;
		
		public function Message()
		{
		}
		
		
		public static function create():TextField
		{
			tf = new TextField();
			tf.defaultTextFormat = new TextFormat("_sans", 12, 0xFFFFFF);
			tf.multiline = true;
			tf.autoSize = TextFieldAutoSize.LEFT;
			return tf;
		}

		
		public static function write(s:String):void
		{
			if (tf.numLines > 10) clear();
			
			tf.appendText(s + "\n");
		}
		
		
		public static function clear():void 
		{
			tf.text = "";
		}

	}
}